home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / frame_14 / PlaceObject2_470_324 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Encoding:
Text File  |  2008-09-24  |  1.4 KB  |  59 lines

  1. onClipEvent(load){
  2.    function getAngle()
  3.    {
  4.       if(InAirCauseJet)
  5.       {
  6.          Angle = 0;
  7.          return undefined;
  8.       }
  9.       yDis = _root[target2]._y - _root[target1]._y;
  10.       deltaX = _root[target1]._x - _root[target2]._x;
  11.       deltaY = _root[target1]._y - _root[target2]._y;
  12.       angle = - Math.atan2(deltaX,deltaY);
  13.       if(_root[target1].onfloor)
  14.       {
  15.          if(_root[target2].onfloor)
  16.          {
  17.             Angle = Math.round(angle * 180 / 3.141592653589793) - 90;
  18.          }
  19.       }
  20.       if(!jet)
  21.       {
  22.          if(!onfloor)
  23.          {
  24.             if(!_root[target1].onfloor)
  25.             {
  26.                if(!_root[target2].onfloor)
  27.                {
  28.                   if(xSpeed >= 0)
  29.                   {
  30.                      Angle += 2;
  31.                   }
  32.                   if(xSpeed < 0)
  33.                   {
  34.                      Angle -= 2;
  35.                   }
  36.                }
  37.             }
  38.          }
  39.       }
  40.    }
  41.    InAirCauseJet = false;
  42.    _visible = false;
  43.    jet = false;
  44.    xAccel = 0.8;
  45.    gravity = 0.5;
  46.    xSpeed = 0;
  47.    ySpeed = 0;
  48.    maxX = 10;
  49.    maxY = 10;
  50.    target1 = this._name + "p1";
  51.    _root.attachMovie("p1",target1,87778);
  52.    _root.depthHolder = _root.depthHolder + 1;
  53.    _root[target1].parent = this;
  54.    target2 = this._name + "p2";
  55.    _root.attachMovie("p2",target2,89798);
  56.    _root.depthHolder = _root.depthHolder + 1;
  57.    _root[target2].parent = this;
  58. }
  59.